setClass("ReduceListComputer",contains="VListComputer",
#		representation(
#				.dummy="ANY"
#		),
		prototype=prototype(
				.description="Reduce List Computer class"
		
		)
)   

setMethod("initialize",
		signature="ReduceListComputer",
		function(.Object,reducer,...){
			.Object <-callNextMethod(.Object,reducer,...)
			return(.Object)
		})

setMethod("get_description",
		signature="ReduceListComputer",
		definition=function(.Object){
			dsc <-get_description(.Object@.reducer)
			return(dsc)
		})


setMethod("computeList",
		signature="ReduceListComputer",
		definition=function(.Object,inputSet,...){
			#check input set
			callNextMethod(.Object,inputSet,...)
			reduced <- reduce(.Object@.reducer,inputSet$X,inputSet$Y)
			inputSet$X <-reduced
			#check illegal values
			containsNas(.Object,inputSet)
			#add fake clusters field to output
			#for compatibility with ReduceClustListComputer
			inputSet[["clusters"]] <- 0
			return(inputSet)
		}
)


